<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      var m = parseInt(prompt("请输入月份"));
      switch (m) {
        case 4:
        case 6:
        case 9:
        case 11:
          alert("30天");
          break;
        case 2:
          let n = parseInt(prompt("请输入年份"));
          if ((n % 4 == 0 && n % 100 != 0) || n % 400 == 0) {
            alert("29天");
          } else {
            alert("28天");
          }
          break;
        default:
          alert("31天");
          break;
      }
    </script>
  </body>
</html>
